package abc.config.interceptor;

import abc.database.Interceptor.ISqlInterceptorFactory;
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Primary
@Component
@Qualifier("sqlInterceptorFactory")
public class QueryInterceptorFactory implements ISqlInterceptorFactory {
    @Override
    public List<InnerInterceptor> getInterceptors() {
        return new ArrayList<>() {{
            add(new QueryInterceptor());
        }};
    }

    @Override
    public <T extends InnerInterceptor> void add(T interceptor) {
    }
}
